home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 November / Macworld (1999-11).dmg / Shareware World / Utilities / Text Processing / Jedit3.0 / Jedit3 / Jedit3.rsrc / TEXT_1000_RegularExpression Help.txt < prev    next >
Text File  |  1999-09-01  |  3KB  |  94 lines

  1. ^   beginning of line 
  2.       if ^ is the first character in the pattern
  3.      Sample: ^subj:    line start with 'subj:'
  4.  
  5. $   end of line 
  6.     if $ is the last character in the pattern.  
  7.     The result doesn't contain return code. 
  8.      To contain return code, specify '\r' instead.
  9.      Sample:  ^$    blank line (without return code)
  10.      Sample:  ^\r   blank line (with return code)
  11.  
  12. .    any character 
  13.      Sample: a.d 
  14.      Start with 'a' and follwed by any character and
  15.      end with 'd'.  It matches in 'and', 'add', 'dandy'.
  16.  
  17. *   zero or more specified patterns
  18.      Sample:    an*d
  19.      Start with 'a' and follewed by zero or more 'n's
  20.      and end with 'd'.  It matches in 'and', 'advance', 
  21.      'add'.
  22.      
  23. +   one or more specified patterns
  24.      Sample:    an+d
  25.      Start with 'a' and follewed by one or more 'n's
  26.      and end with 'd'.  It matches  'and', 'annd' but
  27.      not in  'advance', 'add'.
  28.  
  29. ?   zero or one specified pattern
  30.      Sample:    an?d
  31.      Start with 'a' and follewed by zero or one 'n'
  32.      and end with 'd'.  It matches  'and', 'add' but
  33.      not  'annd'.
  34.  
  35. \   escape
  36.      Use escape pairs when you want to express
  37.      characters that has special meanig in regular
  38.      expression such as '^', '$', '\'.
  39.      Sample:   \^   character '^' as data
  40.      Sample:   \\   character '\' as data
  41.      Sample:   \$   character '$' as data
  42.      Sample:   \*   character '*' as data
  43.      Sample:   \+   character '+' as data
  44.  
  45.      Use escape pairs to express none-printing
  46.      characters as follows.
  47.      '\t' =TAB, '\r' =CR, '\n' =LF, 
  48.      '\s' =SPACE, '\b' =BS
  49.      
  50.      To express characters as hex-decimal codes,
  51.      use '\h' follewed by its hex-decimal codes.
  52.      Sample:   \h20        space (one byte)
  53.      Sample:   \h8140   two bytes kanji space
  54.      
  55. [ ]  character class
  56.      Set and range pattens matches some characters.
  57.      You can use also 2byte characters as its components.
  58.      Use '-' to express  the range pattern. 
  59.      Use '^' to express the exception set.
  60.      Sample:   [abc]    any one of characters a, b, c.   
  61.      Sample:   [A-Z]   any one of characters in the range
  62.                                    A to Z, capital alphabets.
  63.      Sample:  [^a-z]  any one of characters  except small
  64.                                    alphabets. 
  65.      Sample:  [a-xABC] 
  66.                                   any one of characters in the range a 
  67.                                   to x or characters A, B, C.
  68.      Sample:  [\t\s\h8140]+$
  69.                                   one more continuous characters of 
  70.                                   tab, space or kanji space at the end 
  71.                                   of line.
  72.  
  73. {}   group
  74.       Use {} to divide find strings into desired groups that
  75.       are used in replacement strings.
  76.       
  77.       For example, person name is expressed as follows.
  78.       
  79.       {[A-Z][a-z]+}\s+{[A-Z][a-z]+}
  80.  
  81.        First group {[A-Z][a-z]+} is given name.
  82.        Second group {[A-Z][a-z]+} is family name.
  83.  
  84.       First group is expressed as \1 in replacement string,
  85.       second group is \2. 
  86.  
  87.       To replace names to family name first styles, specify 
  88.       follwoing replacement string.
  89.       
  90.       \2, \1
  91.       
  92.       Family name is first, follewed by comma and given
  93.       name.
  94.